package com.cangmaomao.lib.utils

import android.app.Fragment
import android.content.Context
import android.content.SharedPreferences


lateinit var sharedPreferences: SharedPreferences


fun Context.create(name: String): SharedPreferences {
    sharedPreferences = getSharedPreferences(name, Context.MODE_PRIVATE)
    return sharedPreferences
}

fun Fragment.create(name: String): SharedPreferences {
    sharedPreferences = activity.getSharedPreferences(name, Context.MODE_PRIVATE)
    return sharedPreferences
}

fun getEdit(): SharedPreferences.Editor {
    return sharedPreferences.edit()
}
